package com.sxmmall.ware.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@EnableTransactionManagement
@MapperScan("com.sxmmall.ware.dao")
public class WareBatisConfig {

    // 引入分页插件
    @Bean
    public PaginationInterceptor paginationInterceptor(){
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        // 设置页面最大页之后 的操作 ,true 回到首页 false 继续请求
        paginationInterceptor.setOverflow(true);
        // 设置页面最大单页设置  默认 500条, -1 不设置
        paginationInterceptor.setLimit(1000);
         return paginationInterceptor;
    }

}
